﻿var devMedyaslanManset = {
    SelectedIndex: 1,
    MenuPrefix: "devMansetImage",
    SelectedItem: "devMansetImage1",
    Interval: 5000,
    Count: 3,
    Timer: null,
    Next: function () {

        if (this.SelectedIndex < this.Count) {
            this.AutoSelect(++this.SelectedIndex);
        }
        else {
            this.AutoSelect(1);
        }
        this.TimerStart();
    },
    TimerStart: function () {
        this.TimerStop();
        this.Timer = setTimeout("devMedyaslanManset.Next()", this.Interval);
    },
    TimerStop: function () {
        clearTimeout(this.Timer);
    },
    Select: function (index) {
        this.TimerStop();
        this.AutoSelect(index)
    },
    AutoSelect: function (index) {

        $("#" + this.SelectedItem).removeClass("current");
        $("#" + this.SelectedItem + "Big").hide()
        var thumbi = this.MenuPrefix + index.toString();
        var ImageD = this.MenuPrefix + index.toString() + "Big";
        $("#" + thumbi).addClass("current");
        //$("#" + ImageD).fadeIn("slow");
        $("#" + ImageD).show();
        this.SelectedIndex = index;
        this.SelectedItem = this.MenuPrefix + this.SelectedIndex;

    }
}
